package com.baosight.ice.repository;

import com.zeroc.IceGrid.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import java.util.*;

@Repository
public class ApplicationRepository {
    public static Logger logger= LoggerFactory.getLogger(ApplicationRepository.class);

    List<UINode> applicationList=new ArrayList<>();

    public void setApplicationList(List<ApplicationInfo> applicationInfoList){
        for(ApplicationInfo applicationInfo:applicationInfoList){
            ApplicationDescriptor applicationDescriptor=applicationInfo.descriptor;
            for(Map.Entry<String,NodeDescriptor> entry:applicationDescriptor.nodes.entrySet()){
                String nodeName=entry.getKey();
                NodeDescriptor nodeDescriptor=entry.getValue();

            }
        }
    }
//    public List<UINode> getNodeChildren(NodeDescriptor nodeDescriptor){
//        List<UINode> children=new ArrayList<>();
//        for(ServerInstanceDescriptor serverInstanceDescriptor:nodeDescriptor.serverInstances){
//            String templateName = serverInstanceDescriptor.template;
//            Map<String,String> paramValues=serverInstanceDescriptor.parameterValues;
//            //新增一个点
//        }
//        //for(Server)
//    }
}
